class _Engine(object):
	def __int__(self, connect):
		self._connect = connect

	def connect(self):
		return self._connect


engine = None


class _DbCtx(Threading.local):
	def __init__(self):
		self.connection = None
		self.transcation = 0

	def is_init(self):
		return not self.connection is None

	def init(self):
		self.connection = _LasyConnection()
		self.transcation = 0

	def cleanup(self):
		self.connection.cleanup()
		self.connection

	def cursor(self):
		return self.connection.cursor()
